function generate_order(address_id) {
    url = "/cart/payment/";
    //var token = $("#csrfmiddlewaretoken").val();
    data = {
        'address_id':address_id,
        "csrfmiddlewaretoken": $("#csrfmiddlewaretoken").val()
    }
    $.post(url,data,function(data){
        $("#pid").val(data['order_id']);
        $("#checksum").val(data['checksum']);
        var form = document.getElementById("payment_form");
        form.submit();
        //window.location.href = "/";
    });
}